package com.singleton;

/**
 * 私有单例
 * 在其他类中不能通过 new SelfSingleton() 初始化
 *
 * Created by wangg on 2017/12/10.
 */
public class SelfSingleton {
    private static SelfSingleton selfSingleton=null;

    private SelfSingleton() {
    }
    public static SelfSingleton getSingleton(){
        if(selfSingleton==null){
            return new SelfSingleton();
        }
        return selfSingleton;
    }
}
